/**
*      author: Y_Yao
*      created: 2024-10-18 15:23:28
**/

#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 1e18;
const int INF = 0x3f3f3f3f;
const int N = 2e5 + 7;
LL a[N];
int n ;

inline LL f(int i)
{
    return i * (n - i + 1) - 1;
}

inline LL g(int i)
{
    return i * (n - i);
}

void solve()
{
    int q;
    cin >> n >> q;
    map<int,int> ret;
    for(int i = 1;i <= n;i++)
    {
        cin >> a[i];
    }

    for(int i = 1;i < n;i++)
    {
        ret[g(i)] += a[i + 1] - a[i] - 1;
        ret[f(i)]++;
    }
    ret[f(n)]++;

    while(q--)
    {
        int x;
        cin >> x;
        cout << ret[x] << " ";
    }
    cout << endl;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);


    int t = 1;
    cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}